package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.pojo.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BdMapper extends BaseMapper<Article> {

    /**
     * 按照条件查询出前10条  limit 0,10
     * @return
     */
    @Select("SELECT id ,title, (likes*3+collection*8+comment*5) as score FROM ap_article ORDER BY score DESC limit 0,10")
     List<Article> findAll();

}
